Stages are defined according to the TNM classification . The major factor in defining the primary tumor is how deeply it invades through the stomach wall and whether it invades adjacent structures such as the spleen , small intestine or colon, liver, diaphragm, pancreas, kidney, adrenal gland or the abdominal wall. The stage is important in determining the initial treatment options as well as the prognosis .